package com.itheima02.service;

import com.itheima02.dao.StudentDao;
import com.itheima02.dao.StudentDaoDemo;
import com.itheima02.domain.Student;

import java.util.List;

public class StudentServiceDemo implements StudentService{
    StudentDao studentDao = (StudentDao) new StudentDaoDemo();

    @Override
    public List<Student> findAll() {
        return studentDao.findAll();
    }

    @Override
    public Student findByid(Integer id) {
        return studentDao.findByid(id);
    }

    @Override
    public int insert(Student stu) {
        return studentDao.insert(stu);
    }

    @Override
    public int update(Student stu) {
        return studentDao.update(stu);
    }

    @Override
    public int delete(Integer sid) {
        return studentDao.delete(sid);
    }
}
